﻿@{
    Layout = "~/Views/Shared/_Layout.cshtml";
    ViewBag.Title = "Flights Search";
}



<div class="container">

    <div class="blog-header">
        <h1 class="blog-title">Aveiro Airlines Managment System</h1>
        <p class="lead blog-description">API Documentation - Search Flights</p>
    </div>

    <div class="row">

        <div class="col-sm-8 blog-main">

            <div class="blog-post">
                <h2 class="blog-post-title">About this section</h2>
                <p>
                    In this documentation you can find information about the methods that can be used to conduct queries about flights.
                    At this point AAMS API supports two methods for flight searchs.
                    Flights can be <a href="#SearchByID">queried by their id</a> (if known) or by supplying <a href="#SearchByParameters">search parameters</a> such as dates , prices and points of origin and destination.</p>

                <section id="SearchByID">

                    <h2>Search by Flight ID</h2>
                    <p>
                        Use the following specifications to get information about a specific flight (use this only when you have a flight ID).
                    </p>
                    <h3>URI</h3>
                    <pre><code>http://192.168.160.18/AveiroAirlines/api/Flights/GetFlightByID</code></pre>
                    <h3>Method type</h3>
                    <pre><code>GET</code></pre>
                    <h3>Header parameters</h3>
                    <p>
                        Provide your API key token as a header parameter with the name "token".
                    </p>
                    <pre><code>"token"</code></pre>
                    <h3>URL Parameters</h3>
                    <p>
                        provide the flight id as a URL parameter with the name "id"
                    </p>
                    <pre><code>id</code></pre>
                    <h3>Response type</h3>
                    <p>
                        List of details about a specific flight.
                    </p>
                    <pre><code>{
    "Id": "2",
    "DepartureDate": "2014-08-08T00:00:00",
    "ArriveDate": "2014-08-09T12:00:00",
    "Origin": "Barajas",
    "Destination": "Portela",
    "TotalReservations": 0,
    "Lotation": 500,
    "Price": 0
}</code></pre>

                    <h3>Example using <a href="https://chrome.google.com/webstore/detail/postman-rest-client/fdmmgilgnpjigdojojpjoooidkmcomcm">POSTMAN</a></h3>
                    <p>
                        The following image is an example of a call to this API service using POSTMAN
                    </p>
                    <a href="~/Images/POSTMAN-Airports-GetAll.PNG">
                        <img src="~/Images/POSTMAN-Airports-GetAll.PNG" class="img-thumbnail" alt="Responsive image" />
                    </a>


                </section>
                
                <hr />
                <hr />

                <section id="SearchByParameters">

                    <h2>Search by flight parameters</h2>
                    <p>
                        Use the following specifications to get information about a specific flights that mach a set of provided restrictions.
                    </p>
                    <h3>URI</h3>
                    <pre><code>http://192.168.160.18/AveiroAirlines/api/Flights/GetFlightByID</code></pre>
                    <h3>Method type</h3>
                    <pre><code>GET</code></pre>
                    <h3>Header parameters</h3>
                    <p>
                        Provide your API key token as a header parameter with the name "token".
                    </p>
                    <pre><code>"token"</code></pre>
                    <h3>URL Parameters</h3>
                    <p>
                       Flights can be queried by time intervals (begin and end date), price limit, points of origin and destination
                    </p>
                    <pre><code>"BeginDate" <br />"EndDate" (option)<br />"PriceLimit" (optional)<br />"Origin"<br />"Destination"</code></pre>
                    <h3>Response type</h3>
                    <p>
                        A List of flights that mach the specified parameters.
                    </p>
                    <pre><code>[
    {
        "Id": "2",
        "DepartureDate": "2014-08-08T00:00:00",
        "ArriveDate": "2014-08-09T12:00:00",
        "Origin": "Barajas",
        "Destination": "Portela",
        "TotalReservations": 0,
        "Lotation": 500,
        "Price": 100
    }
]</code></pre>

                    <h3>Example using <a href="https://chrome.google.com/webstore/detail/postman-rest-client/fdmmgilgnpjigdojojpjoooidkmcomcm">POSTMAN</a></h3>
                    <p>
                        The following image is an example of a call to this API service using POSTMAN
                    </p>
                    <a href="~/Images/POSTMAN-Flight-Query.PNG">
                        <img src="~/Images/POSTMAN-Flight-Query.PNG" class="img-thumbnail" alt="Responsive image" />
                    </a>


                </section>
                
                <hr>
            </div><!-- /.blog-post -->

            <ul class="pager">
                <li>@Html.ActionLink("Prev. - Airports", "", "Airports")</li>
                <li>@Html.ActionLink("Next - Flight Reservation", "", "FlightReservation")</li>
            </ul>

        </div><!-- /.blog-main -->

        <div class="col-sm-3 col-sm-offset-1 blog-sidebar">
            <div class="sidebar-module sidebar-module-inset">
                <h4>About the authors</h4>
                <p>This page and all its content were developed by <em>José Brazeta</em>, <em>Luis Carta</em> and <em>João Martins</em> as an assignment for Advanced Web Programing (AEP), a course of the master degree in Information Systems at Aveiro University
            </div>
            <div class="sidebar-module">
                <h4>Other information:</h4>
                <ol class="list-unstyled">
                    <li><a href="#">AAMS Main Page</a></li>
                    <li><a href="#">Capsule CRM API</a></li>
                    <li><a href="#">Kashflow Main Page</a></li>
                </ol>
            </div>
            <div class="sidebar-module">
                <h4>Codeplex Repository</h4>
                <ol class="list-unstyled">
                    <li><a href="#">Get AAMS from Codeplex</a></li>
                </ol>
            </div>
        </div><!-- /.blog-sidebar -->

    </div><!-- /.row -->

</div>